import request from '@/config/axios'

export interface ConfigVO {
  payMemberConfigId?: number
  payMemberIsEnable?: Boolean //是否开启付费会员
  salesChannel?: EmptyArrayType //启用渠道
  salesOnlineChannel?: EmptyArrayType // 线上商品销售渠道
  authorizedTenant?: EmptyArrayType //门店
  authorizedMallTenant?: EmptyArrayType //商城
  payMemberProtocolName?: string //付费会员协议名称
  payMemberProtocol?: string //付费会员协议
}

// 查询付费会员设置详情
export const getConfig = async () => {
  return await request.get({ url: `/product/paymember/config/get` })
}

// 新增修改付费会员设置
export const saveConfig = async (data: ConfigVO) => {
  return await request.put({ url: `/product/paymember/config/addOrUpdate`, data })
}
